-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tests): fix reconfiguration completion detection #12117
Conversation
8538677
to
2cee947
Compare
5c190ea
to
2f8eb74
Compare
b4a4204
to
622e9e4
Compare
Previously, the transaction ID that was reported was from before the admin API request was finished. Also, invalidations could sometimes be delayed long enough to cause a conditional request to be executed even though a subsystem has not been rebuilt. This change fixes the behavior in multiple ways: - Invalidations are invoked from the DAO:post_crud_event in a synchronous fashion rather than having event handlers invalidate. This ensures that when the admin API request finishes, the cache is invalidated as well. - The transaction ID is saved to the nginx context in `DAO:post_crud_event` and set in the response header in the `Kong.admin_header_filter` function. - The current transaction ID is retrieved by the data plane from the shared cache instead of from Postgres. Previously, every iteration of the rebuild cycle incremented the current transaction ID by one, making debugging more difficult.
a5e2e8e
to
d2d4242
Compare
Hello @hanshuebner , temporarily converting this to Draft so we can wait for the updated design doc. Let's take a bit more time and make sure to execute it properly. Please also briefly describe the issue encountered with the first design in the updated design doc. cc @hbagdi , will ping you once the updated design doc is up. |
@dndx I've updated https://docs.google.com/document/d/1SOFb8eQWwBgWlLPppQHAN7kSg9eHkDirjgDGAmOPRro/edit according to your request. |
@hbagdi says that it is too risky to change the invalidation behavior to support testing better. Closing this PR. |
Summary
Previously, the transaction ID that was reported was from before the admin API request was finished. Also, invalidations could sometimes be delayed long enough to cause a conditional request to be executed even though a subsystem has not been rebuilt.
This change fixes the behavior in multiple ways:
Invalidations are invoked from the DAO:post_crud_event in a synchronous fashion rather than having event handlers invalidate. This ensures that when the admin API request finishes, the cache is invalidated as well.
The transaction ID is saved to the nginx context in
DAO:post_crud_event
and set in the response header in theKong.admin_header_filter
function.The current transaction ID is retrieved by the data plane from the shared cache instead of from Postgres. Previously, every iteration of the rebuild cycle incremented the current transaction ID by one, making debugging more difficult.
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
KAG-3195